package org.ailoli.aixiang.io.net

import okhttp3.OkHttpClient
import retrofit2.Retrofit


//object RetrofitUtils {
//    val defaultServer: IApiServer
//        get() = Tool.defaultServer
//
//    private object Tool {
//        var defaultServer: IApiServer = initRetrofitServer(NetConfig.BASE_URL)
//        fun initRetrofitServer(baseUrl: String?): IApiServer {
//            val DEFAULT_TIME = 15 //默认超时时间
//            val builder = OkHttpClient.Builder()
//            builder.readTimeout(DEFAULT_TIME.toLong(), TimeUnit.SECONDS)
//            builder.connectTimeout(DEFAULT_TIME.toLong(), TimeUnit.SECONDS)
//            //        builder.addInterceptor(new LoggingInterceptor());//使用自定义的Log拦截器
//            val client = builder.build()
//            return Retrofit.Builder()
//                .baseUrl(baseUrl)
//                .addConverterFactory(FastJsonConverterFactory.create())
//                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
//                .client(client)
//                .build()
//                .create<IApiServer>(IApiServer::class.java)
//        }
//    }
//}